package com.huluobo.h3kotlindemo.home

import androidx.lifecycle.MutableLiveData
import com.huluobo.h3kotlindemo.base.BaseViewModel

/**
 *  Created by LC on 2023/11/3.
 */
class HomeViewModel : BaseViewModel() {
    private val repo = HomeRepo()
    val getHomeListSuccess = MutableLiveData<HomeListBeanResult>()
    val getHomeListFailed = MutableLiveData<String>()

    val getHomeBannerSuccess = MutableLiveData<HomeBannerBeanResult>()
    val getHomeBannerFailed = MutableLiveData<String>()
    fun getHomeList(
        categoryId: Int,
        currentPage: Int,
        pageSize: Int,
    ) {
        repo.getHomeList(categoryId, currentPage, pageSize, getHomeListSuccess, getHomeListFailed)
    }

    fun getHomeBanner() {
        repo.getHomeBanner(getHomeBannerSuccess, getHomeBannerFailed)
    }
}